/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.app.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Thuan
 */
@Embeddable
public class AssignmentOfBatchPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "assignmentId")
    private int assignmentId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "batchId")
    private int batchId;

    public AssignmentOfBatchPK() {
    }

    public AssignmentOfBatchPK(int assignmentId, int batchId) {
        this.assignmentId = assignmentId;
        this.batchId = batchId;
    }

    public int getAssignmentId() {
        return assignmentId;
    }

    public void setAssignmentId(int assignmentId) {
        this.assignmentId = assignmentId;
    }

    public int getBatchId() {
        return batchId;
    }

    public void setBatchId(int batchId) {
        this.batchId = batchId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) assignmentId;
        hash += (int) batchId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AssignmentOfBatchPK)) {
            return false;
        }
        AssignmentOfBatchPK other = (AssignmentOfBatchPK) object;
        if (this.assignmentId != other.assignmentId) {
            return false;
        }
        if (this.batchId != other.batchId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.app.model.AssignmentOfBatchPK[ assignmentId=" + assignmentId + ", batchId=" + batchId + " ]";
    }

}
